<?php if (!defined('THINK_PATH')) exit();?><link rel="stylesheet" href="__PUBLIC__/Catalog/css/layout.css" />
<link rel="stylesheet" href="__PUBLIC__/Catalog/css/typo.css" />
<link rel="stylesheet" href="__PUBLIC__/Catalog/css/basic.css" />
<link rel="stylesheet" href="__PUBLIC__/Catalog/css/basic.css" />
 <link rel="stylesheet" href="__PUBLIC__/Catalog/css/calendar.css" />
 <script type="text/javascript" src="__PUBLIC__/Catalog/js/jquery-1.11.1.js"></script>
<script>
function cmessage(x,l){
    $('.m_day'+x).attr('id','m'+l);
    if($('.m_day'+x).length > 1){
        var height = parseInt($('#m'+l).css('top'));
        //console.log(height);
        for (var i = 0 ; i < $('.m_day'+x).length; i++) {
            $('.m_day'+x+':eq('+i+')').css('top',height);
            height += parseInt($('.m_day'+x+':eq('+i+')').css('height'))+15;
        };
        $('.m_day'+x).stop().show('fast');
    }else{
        $('.m_day'+x).stop().show('fast');
    }
}
function cmessage_hide() {
    $(".calendar_mouseover").stop().hide('fast');
}
</script>
<div class="calendar">
<?php $day = array(); ?>
<?php foreach ($conferences as $v): ?>
    <?php $day[] = date('j',strtotime($v['date'])); ?>
    <div class="calendar_mouseover m_day<?php echo (date( 'j',strtotime($v['date']))); ?>">
        <?php echo ($v['inner_title']); ?>
    </div>
<?php endforeach ?>
<?php  if(empty($_GET['count'])||empty($_GET['currentY'])||empty($_GET['currentM'])){ $year = date ( 'Y' ); $month = date ( 'n' ); }else{ if($_GET['currentM']==12&&$_GET['count']==1){ $month = 1; $year = $_GET['currentY']+$_GET['count']; }else if(($_GET['currentM']==1||$_GET['currentM']==01)&&$_GET['count']==-1){ $month = 12; $year = $_GET['currentY']+$_GET['count']; }else{ $month = $_GET['currentM']+$_GET['count']; $year = $_GET['currentY']; } } $firstDay = date ( "w", mktime ( 0, 0, 0, $month, 1, $year ) ); $daysInMonth = date ( "t", mktime ( 0, 0, 0, $month, 1, $year ) ); $tempDays = $firstDay + $daysInMonth; $weeksInMonth = ceil ( $tempDays/7 ); $counter = 0; for($j = 0; $j < $weeksInMonth; $j ++) { for($i = 0; $i < 7; $i ++) { $counter ++; $week [$j] [$i] = $counter; $week [$j] [$i] -= $firstDay; if (($week [$j] [$i] < 1) || ($week [$j] [$i] > $daysInMonth)) { $week [$j] [$i] = ""; } } } ?> 
<table width="252" border="0" cellpadding="0" cellspacing="0"> 
    <tr class="calendar-year"> 
        <th colspan='7' > 
            <?php  echo '<a href="?currentY='.$year.'&currentM='.$month.'&count=-1" class="calendar_left"><img src="__PUBLIC__/Catalog/images/calendar_left.png" border="0" ></a>        '.date ( 'M', mktime ( 0, 0, 0, $month, 1, $year ) ) . ' ' . $year.'        <a href="?currentY='.$year.'&currentM='.$month.'&count=1" class="calendar_right"><img src="__PUBLIC__/Catalog/images/calendar_right.png" border="0"></a>'; ?> 
        </th>
    </tr> 
    <tr class="calendar_week"> 
        <th class="calendar_sun" >S</th> 
        <th >M</th>
        <th >T</th> 
        <th >W</th> 
        <th >T</th> 
        <th >F</th> 
        <th >S</th> 
    </tr> 
<?php
$fcolor = '#868686'; $cursor = ''; $x = 0; $y = 0; $tcount = ''; foreach ( $week as $key => $val ) { echo "<tr height='32px'>"; for($i = 0; $i < 7; $i ++) { if(!empty($val [$i])){ if(in_array($val[$i],$day)){ $cl ='calendar_day_s'; $cursor = 'pointer'; }else{ $cl ='calendar_day'; $cursor = 'pointer'; } $y = 1; }else{ $cl ='calendar_none'; $cursor = ''; } $x = $x+1; if($y==1){ echo "<td align='center' style='cursor:".$cursor."' onmouseout='cmessage_hide()' onmouseover='cmessage(".$val [$i].",".$x.")' class=".$cl.">" . $val [$i] . "</td>"; $y = 0; }else{ echo "<td align='center' style='cursor:".$cursor."' class=".$cl.">" . $tcount . "</td>"; } } echo "</tr>"; } ?> 

</table>
</div>
<div class="bg-gray padding-10" style="width:232px">
    <h1>Newsletters</h1>
    <div class="banner-border">
        <a href="<?php echo U('Info/news');?>" target="_parent">
            <img src="__PUBLIC__/Catalog/images/newsletter.jpg"  width="100%"/>
        </a>
    </div>
</div>